﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using General.Core.Data;
using General.Entities;

using General.Entities.Students;
using Microsoft.AspNetCore.Mvc;

namespace General.Services.Students
{
    public class StudentsAppService : IStudentsAppService
    {
        //private IRepository<Entities.Students.Students> _studentsRepository;

        //public StudentsService(IRepository<Entities.Students.Students> studentsRepository)
        //{
        //    _studentsRepository = studentsRepository;
        //}


        //public List<Entities.Students.Students> getAll()
        //{
        //    return _studentsRepository.Table.ToList();
        //}

        /// <summary>
        /// 根据ID获取学生
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet("{id:int}")]
        public Entities.Students.Students Get(int id)
        {
            return new Entities.Students.Students() { id = 1,  name = "张三",  pwd= "123456" };
        }

        /// <summary>
        /// 获取所有学生
        /// </summary>
        /// <returns></returns>
        public List<Entities.Students.Students> Get()
        {
            return new List<Entities.Students.Students>()
        {
            new Entities.Students.Students(){ id = 1,  name = "张三",  pwd= "123456" },
            new Entities.Students.Students(){ id = 1,  name = "李四",  pwd= "123456" }
        };
        }

        /// <summary>
        /// 更新学生信息
        /// </summary>
        /// <param name="input"></param>
        public void Update(Entities.Students.Students input)
        {
            throw new System.NotImplementedException();
        }

        /// <summary>
        /// 更新学生年龄
        /// </summary>
        /// <param name="age"></param>
        [HttpPatch("{id:int}/age")]
        public void UpdateAge(int age)
        {
            throw new System.NotImplementedException();
        }

        /// <summary>
        /// 根据ID删除学生
        /// </summary>
        /// <param name="id"></param>
        [HttpDelete("{id:int}")]
        public void Delete(int id)
        {
            throw new System.NotImplementedException();
        }

        /// <summary>
        /// 添加学生
        /// </summary>
        /// <param name="input"></param>
        public void Create(Entities.Students.Students input)
        {
            throw new System.NotImplementedException();
        }


    }
}
